package com.itheima.exception;

public class ExceptionDemo1 {
    public static void main(String[] args) {
        try {
            int[] arr = {1, 2, 3};

                arr = null;

            System.out.println(arr[0]);
            System.out.println(arr[3]);
            System.out.println(arr[1]);
        }catch (NullPointerException n){
            System.out.println("空指针");
        }catch (Throwable e){
            System.out.println("有问题");
        }
        System.out.println("其他代码逻辑");
    }
}
